home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Codigo / Imágenes y mapas de bits / ImageFromFile / ImageFromFile.cs next >
Encoding:
Text File  |  2002-05-06  |  654 b   |  25 lines

  1. //--------------------------------------------
  2. // ImageFromFile.cs ⌐ 2001 by Charles Petzold
  3. //--------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class ImageFromFile: PrintableForm
  9. {
  10.      public new static void Main()
  11.      {
  12.           Application.Run(new ImageFromFile());
  13.      }
  14.      public ImageFromFile()
  15.      {
  16.           Text = "Imagen de archivo";
  17.      }
  18.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  19.      {
  20.           Image image = Image.FromFile("..\\..\\..\\Apollo11FullColor.jpg");
  21.  
  22.           grfx.DrawImage(image, 0, 0);
  23.      }
  24. }
  25.